/**
 * 
 */
package com.iapcursos.portal.procefet.modelo.beans.sessions;

import java.util.List;

import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import javax.persistence.Query;

import com.iapcursos.portal.procefet.modelo.beans.entitys.Papel;
import com.iapcursos.portal.procefet.modelo.beans.sessions.interfaces.GerenciadorPapeis;

/**
 * @author Gleison
 *
 */
@Stateless(mappedName="gerenciadorPapeis")
public class GerenciadorPapeisBean implements GerenciadorPapeis {
	
	@PersistenceContext(unitName="iap")
	private EntityManager entityManager;
	/**
	 * 
	 */
	public GerenciadorPapeisBean() {
		// TODO Auto-generated constructor stub
	}

	@Override
	public List<Papel> recuperarPapeis() {
		return null;
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<String> recuperarNomePapeis() {
		Query consulta = entityManager.createNamedQuery("distinctNamesPapeis");
		List<String> nomesPapeis = consulta.getResultList();
		return nomesPapeis;
	}

}
